home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / zipit11.zip / QSEARCH.TXT < prev    next >
Text File  |  1992-10-25  |  2KB  |  42 lines

  1. Declare Function FindString Lib "QSEARCH.DLL" (ByVal iSwitch As Integer, 
  2. ByVal lpPathName As String, ByVal lpSearchString As String, ByVal hWnd As 
  3. Integer) As Integer
  4.  
  5. Declare Function CopyFile Lib "QSEARCH.DLL" (ByVal lpSourcePath As String, 
  6. ByVal lpDestPath As String, ByVal bSwitch As Integer) As Integer
  7.  
  8. Declare Function FindFile Lib "QSEARCH.DLL" (ByVal lpDrive As String, 
  9. ByVal lpPattern As String, ByVal hWnd As Integer) As Integer
  10.  
  11. Sample usage:
  12.  
  13. List1.SetFocus
  14. h% = GetFocus()
  15. i% = FindString(1, "c:\dos\help.txt", "xcopy", h%)
  16.  
  17. 'searches "c:\dos\help.txt" and puts all lines containing 
  18. "xcopy" in listbox with h% 'as hWnd. The first number is a 
  19. switch for case sensitivity and line numbers. 0 = 'case 
  20. sensitive (-1 with line numbers), 1 = not sensitive (2 with 
  21. line numbers) 'It returns the number of lines containing 
  22. searchstring or -1 if error opening 'file.
  23.  
  24.  
  25. i% = CopyFile("c:\windows\winhelp.exe", "a:\winhelp.exe", 1)
  26.  
  27. 'Copies first argument to second argument. Third argument is a 
  28. boolean switch, '0 = copy without file info, 1 = copy with date 
  29. and attribute. It returns 0 on 'success or errors outlined in 
  30. qsearch.h (at end of qsearch.c).  
  31.  
  32. List1.SetFocus
  33. h% = GetFocus()
  34. i% = FindFile("d", "*.txt", h%)
  35.  
  36. 'Finds files on "d" drive that match the pattern "*.txt" and 
  37. places the matches in 'the list box with h% as hWnd. It returns 
  38. matches found or -1 if error changing to 'selected drive. Note: 
  39. No error checking on floppy drives. If door is open, return 
  40. 'will be zero.
  41.  
  42.